package extend.exer02;

/**
 * @author shkstart
 * @date 2022/5/9 - 21:20
 */
public class Cylinder extends Circle {
    private double length;

    public Cylinder() {
        length = 1.0;
    }

    public double getLength() {
        return length;
    }

    public void setLength(double length) {
        this.length = length;
    }

    public double findVolume() { //返回圆的体积
        return Math.PI * getRadius() * getRadius() * getLength();
//        return super.findArea() * getLength(); 返回圆的面积
    }


    public double findArea() { //返回圆的表面积 2*pi*r*r + 2*pi*r*l;
        return Math.PI * getRadius() * getRadius()
                * 2 + 2 * Math.PI * getRadius() * getLength();
    }
}
